package edu.zut.util;

import sun.misc.BASE64Encoder;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Util {

    public static void main(String[] args) throws NoSuchAlgorithmException, IOException {
        MessageDigest md5 = MessageDigest.getInstance("md5");
        BASE64Encoder encoder = new BASE64Encoder();
        String s = encoder.encode(md5.digest("123456".getBytes(StandardCharsets.UTF_8)));
        System.out.println("s = " + s);
    }

}
